package com.yyj.web.controller;

import com.yyj.common.BaseResponse;
import com.yyj.constant.ReturnCode;
import com.yyj.constant.WebConstant;
import com.yyj.service.PaymentService;
import com.yyj.util.RspUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ScheduleController extends BaseController {

    @Autowired
    PaymentService paymentService;

    @RequestMapping(value = "/schedule/initSanitary" , method = RequestMethod.GET)
    public BaseResponse initSanitaryPayment(){
        try{
            paymentService.initSanitaryPayment();
            return RspUtils.success();

        }catch(Exception e){
            logger.error("initSanitary异常：{}" , e.getMessage() , e);
            return RspUtils.error(ReturnCode.NORMAL_ERROR , e.getMessage());
        }
    }

    @RequestMapping(value = "/schedule/initProperty" , method = RequestMethod.GET)
    public BaseResponse initPropertyPayment(){
        try{
            paymentService.initPropertyPayment();
            return RspUtils.success();

        }catch(Exception e){
            logger.error("initProperty异常：{}" , e.getMessage() , e);
            return RspUtils.error(ReturnCode.NORMAL_ERROR , e.getMessage());
        }
    }

}
